package com.ww.java8.fp.stream.onjava8.ch14;

import java.io.IOException;

/**
 * peek()操作的目的是帮助调试，它允许你无修改地查看流中的元素
 */
public class PeekDemo {

    public static void main(String[] args) throws IOException {
        new SplitStreamRegexpDemo(PeekDemo.class.getResource("/").getPath().substring(1) + "Cheese.dat")
                .stream().skip(21)
                .limit(4)
                .map(w -> w + " ")
                .peek(System.out::print);
    }
}
